package proj;

/**
 * @Description: 宠物类，父类
 * @author: muxiongxiong
 * @date: 2021年07月05日 9:11
 * 公众号：雄雄的小课堂
 * 博客：https://blog.csdn.net/qq_34137397
 * 个人站：http://www.穆雄雄.com
 * 个人站：http://www.muxiongxiong.cn
 * abstract:抽象类
 */
public abstract class Pet {

    private String name;
    private int health;
    private int love;

    public Pet() {

    }

    public Pet(String name, int health, int love) {
        this.name = name;
        this.health = health;
        this.love = love;
    }


    //添加构造方法

    /**
     * 自我介绍
     */
    public void show() {
        System.out.println("名字：" + this.name);
        System.out.println("健康值是：" + this.health);
        System.out.println("亲密度是：" + this.love);
    }

    //方法的重写(抽象方法)
    public abstract void print();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }
}
